<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>中药处方格式化工具</title>
<style>
  body {
    font-family: Arial, sans-serif;
  }
  textarea, pre {
    width: 100%;
    height: 200px;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
	overflow: auto;
  }
</style>
</head>
<body>
  <h1>输入中药：</h1>
  <textarea id="inputTextarea" placeholder="在此输入内容"></textarea>
  <button id="copyButton">复制下方内容</button>
  <h2>正则化后：</h2>
  <pre style='height: auto;min-height: 200px' id="outputPre"></pre>

  <script src="script.js"></script>
  <script>
    document.getElementById('copyButton').addEventListener('click', function() {
      const outputPre = document.getElementById('outputPre');
      const textToCopy = outputPre.textContent || outputPre.innerText;

      const textarea = document.createElement('textarea');
      textarea.value = textToCopy;
      document.body.appendChild(textarea);
      textarea.select();
      document.execCommand('copy');
      document.body.removeChild(textarea);
    });
  </script>
</body>
</html>
